This is a creation in
Article, where the information may have evolved or changed.
Functional function
Listen and listen-the GO function does not support nesting, overloading, and default parameters
Listen and listen-but the following features are
Functional function-The GO function does not support nesting, overloading, and default parameters-however, the following features are supported:No need to declare a prototype, variable length parameter, multiple return value, command return value
This is a creation in
Article, where the information may have evolved or changed.
Indispensable function, the way to define functions in Go is as follows:
func (p myType ) funcName ( a, b int , c string ) ( r , s int ) { return}
With function
The confusions encountered when learning generics are often confused with func , funcThe confusion encountered when learning generics is often confused with func . The last value is always considered to be the return type. Now let's make a
Func, Action
Introduction and usage
Func is a type of Delegate, which is added in 3.5. in 2.0, we use the delegate to use delegate, and func is located in system. in the core namespace, the use of delegation can improve the efficiency. For
_ FUNC _ is a predefined identifier in the c99 standard, which is a static const char [],It is implicitly defined in every function using _ FUNC.
The following is an example in iso9899.# Include Void myfunc (void){Printf ("% s/n", _ FUNC __);/*...*/}
C # the usage of Action and Func,
In the past, I used to define a delegate to write the delegate, but recently I have seen that some foreigners write the source code in the action and func modes, at that time, I felt unfamiliar with the source code,
It's always been a bit confusing for events and delegates, and it's not going to work. Find a time, summed up a bit, feel a lot clearer.
Let's start with a personal understanding of the conclusion that:
delegate is a type in C # that is actually a
C # delegate introduction (delegate, Action, Func, predicate ),A delegate is a class that defines the type of a method so that the method can be passed as a parameter of another method. An event is a special delegate.
1. Delegate statement
(1).
It is possible for a C program to print the currently executing line of source code, the file of the source code, and the name of the current function. the currently executing line is available in a Preprocessor variable called__LINE__:
#include int
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.